<template>
  <div class="contain">
    <NavBar title="预约结果"></NavBar>
    <div class="imgbox">
      <img src="../assets/images/success.png" v-if="state === 0" alt="" />
      <img src="../assets/images/error.png" v-if="state === 1" alt="" />
    </div>
    <div class="flex-colum box">
      <div class="card">
        <div class="cell flex-row">
          <p class="left">预约人</p>
          <p class="right">{{ data.tel }}</p>
        </div>
        <div class="cell flex-row">
          <p class="left">预约单位</p>
          <p class="right">{{ data.yyCompany }}</p>
        </div>
        <div class="cell flex-row">
          <p class="left">预约日期</p>
          <p class="right">{{ data.yearMoney }}</p>
        </div>
        <div class="cell flex-row">
          <p class="left">预约状态</p>
          <p class="right" v-if="state === 0">预约成功</p>
          <p class="right" v-if="state === 1">预约失败</p>
        </div>
        <div class="cell flex-row" v-if="state === 1">
          <p class="left">失败原因</p>
          <p class="right">今日预约已满</p>
        </div>
      </div>
      <div class="btn" @click="$go('/')">返回首页</div>
    </div>
  </div>
</template>
<script>
import NavBar from "@/components/NavBar.vue";
export default {
  data() {
    return {
      state: 0,
      data: this.$route.params.data,
    };
  },
  components: { NavBar },
  computed: {},
  mounted() {
    console.log(this.data);
  },
  beforeDestroy() {},
};
</script>

<style lang="less" scoped>
.card {
  width: 100%;
  padding: 4px 20px;
  box-sizing: border-box;
  background-color: #fff;
  border-radius: 9px;
}
.contain {
  width: 100%;
  min-height: 100vh;
  background-color: rgb(246, 246, 246);
  .imgbox {
    min-height: 280px;
    display: flex;
    align-items: end;
  }
  img {
    width: 100%;
    margin-top: 30px;
  }
}
.box {
  width: 100%;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
  margin-top: -30px;
}
.title {
  font-weight: 600;
  font-size: 25px;
  color: #333333;
  line-height: 36px;
}
.btn {
  width: 100%;
  height: 50px;
  text-align: center;
  line-height: 50px;
  background-color: #5a94f3;
  font-weight: 500;
  font-size: 22px;
  color: #ffffff;
  margin-top: 40px;
  border-radius: 15px;
}
.cell {
  padding: 8px 0;
  box-sizing: border-box;
  align-items: center;
  justify-content: space-between;
  .left {
    font-weight: 400;
    font-size: 15px;
    color: #333333;
    line-height: 22px;
  }
  .right {
    font-weight: 400;
    font-size: 15px;
    color: #a4a4a4;
    line-height: 22px;
  }
}
</style>
